(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
double(0) → 0
double(s(x)) → s(s(double(x)))
half(0) → 0
half(s(0)) → 0
half(s(s(x))) → s(half(x))
-(x, 0) → x
-(s(x), s(y)) → -(x, y)
if(0, y, z) → y
if(s(x), y, z) → z
half(double(x)) → x
Rewrite Strategy: FULL
(1) DecreasingLoopProof (EQUIVALENT transformation)
The following loop(s) give(s) rise to the lower bound Ω(n1):
The rewrite sequence
double(s(x)) →+ s(s(double(x)))
gives rise to a decreasing loop by considering the right hand sides subterm at position [0,0].
The pumping substitution is [x / s(x)].
The result substitution is [ ].
(2) BOUNDS(n^1, INF)
(3) RenamingProof (EQUIVALENT transformation)
Renamed function symbols to avoid clashes with predefined symbol.
(4) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
double(0') → 0'
double(s(x)) → s(s(double(x)))
half(0') → 0'
half(s(0')) → 0'
half(s(s(x))) → s(half(x))
-(x, 0') → x
-(s(x), s(y)) → -(x, y)
if(0', y, z) → y
if(s(x), y, z) → z
half(double(x)) → x
S is empty.
Rewrite Strategy: FULL
(5) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(6) Obligation:
TRS:
Rules:
double(0') → 0'
double(s(x)) → s(s(double(x)))
half(0') → 0'
half(s(0')) → 0'
half(s(s(x))) → s(half(x))
-(x, 0') → x
-(s(x), s(y)) → -(x, y)
if(0', y, z) → y
if(s(x), y, z) → z
half(double(x)) → x
Types:
double :: 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
half :: 0':s → 0':s
- :: 0':s → 0':s → 0':s
if :: 0':s → if → if → if
hole_0':s1_0 :: 0':s
hole_if2_0 :: if
gen_0':s3_0 :: Nat → 0':s
(7) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
double, half, -
(8) Obligation:
TRS:
Rules:
double(
0') →
0'double(
s(
x)) →
s(
s(
double(
x)))
half(
0') →
0'half(
s(
0')) →
0'half(
s(
s(
x))) →
s(
half(
x))
-(
x,
0') →
x-(
s(
x),
s(
y)) →
-(
x,
y)
if(
0',
y,
z) →
yif(
s(
x),
y,
z) →
zhalf(
double(
x)) →
xTypes:
double :: 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
half :: 0':s → 0':s
- :: 0':s → 0':s → 0':s
if :: 0':s → if → if → if
hole_0':s1_0 :: 0':s
hole_if2_0 :: if
gen_0':s3_0 :: Nat → 0':s
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
The following defined symbols remain to be analysed:
double, half, -
(9) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
double(
gen_0':s3_0(
n5_0)) →
gen_0':s3_0(
*(
2,
n5_0)), rt ∈ Ω(1 + n5
0)
Induction Base:
double(gen_0':s3_0(0)) →RΩ(1)
0'
Induction Step:
double(gen_0':s3_0(+(n5_0, 1))) →RΩ(1)
s(s(double(gen_0':s3_0(n5_0)))) →IH
s(s(gen_0':s3_0(*(2, c6_0))))
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(10) Complex Obligation (BEST)
(11) Obligation:
TRS:
Rules:
double(
0') →
0'double(
s(
x)) →
s(
s(
double(
x)))
half(
0') →
0'half(
s(
0')) →
0'half(
s(
s(
x))) →
s(
half(
x))
-(
x,
0') →
x-(
s(
x),
s(
y)) →
-(
x,
y)
if(
0',
y,
z) →
yif(
s(
x),
y,
z) →
zhalf(
double(
x)) →
xTypes:
double :: 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
half :: 0':s → 0':s
- :: 0':s → 0':s → 0':s
if :: 0':s → if → if → if
hole_0':s1_0 :: 0':s
hole_if2_0 :: if
gen_0':s3_0 :: Nat → 0':s
Lemmas:
double(gen_0':s3_0(n5_0)) → gen_0':s3_0(*(2, n5_0)), rt ∈ Ω(1 + n50)
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
The following defined symbols remain to be analysed:
half, -
(12) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
half(
gen_0':s3_0(
*(
2,
n249_0))) →
gen_0':s3_0(
n249_0), rt ∈ Ω(1 + n249
0)
Induction Base:
half(gen_0':s3_0(*(2, 0))) →RΩ(1)
0'
Induction Step:
half(gen_0':s3_0(*(2, +(n249_0, 1)))) →RΩ(1)
s(half(gen_0':s3_0(*(2, n249_0)))) →IH
s(gen_0':s3_0(c250_0))
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(13) Complex Obligation (BEST)
(14) Obligation:
TRS:
Rules:
double(
0') →
0'double(
s(
x)) →
s(
s(
double(
x)))
half(
0') →
0'half(
s(
0')) →
0'half(
s(
s(
x))) →
s(
half(
x))
-(
x,
0') →
x-(
s(
x),
s(
y)) →
-(
x,
y)
if(
0',
y,
z) →
yif(
s(
x),
y,
z) →
zhalf(
double(
x)) →
xTypes:
double :: 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
half :: 0':s → 0':s
- :: 0':s → 0':s → 0':s
if :: 0':s → if → if → if
hole_0':s1_0 :: 0':s
hole_if2_0 :: if
gen_0':s3_0 :: Nat → 0':s
Lemmas:
double(gen_0':s3_0(n5_0)) → gen_0':s3_0(*(2, n5_0)), rt ∈ Ω(1 + n50)
half(gen_0':s3_0(*(2, n249_0))) → gen_0':s3_0(n249_0), rt ∈ Ω(1 + n2490)
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
The following defined symbols remain to be analysed:
-
(15) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
-(
gen_0':s3_0(
n676_0),
gen_0':s3_0(
n676_0)) →
gen_0':s3_0(
0), rt ∈ Ω(1 + n676
0)
Induction Base:
-(gen_0':s3_0(0), gen_0':s3_0(0)) →RΩ(1)
gen_0':s3_0(0)
Induction Step:
-(gen_0':s3_0(+(n676_0, 1)), gen_0':s3_0(+(n676_0, 1))) →RΩ(1)
-(gen_0':s3_0(n676_0), gen_0':s3_0(n676_0)) →IH
gen_0':s3_0(0)
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(16) Complex Obligation (BEST)
(17) Obligation:
TRS:
Rules:
double(
0') →
0'double(
s(
x)) →
s(
s(
double(
x)))
half(
0') →
0'half(
s(
0')) →
0'half(
s(
s(
x))) →
s(
half(
x))
-(
x,
0') →
x-(
s(
x),
s(
y)) →
-(
x,
y)
if(
0',
y,
z) →
yif(
s(
x),
y,
z) →
zhalf(
double(
x)) →
xTypes:
double :: 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
half :: 0':s → 0':s
- :: 0':s → 0':s → 0':s
if :: 0':s → if → if → if
hole_0':s1_0 :: 0':s
hole_if2_0 :: if
gen_0':s3_0 :: Nat → 0':s
Lemmas:
double(gen_0':s3_0(n5_0)) → gen_0':s3_0(*(2, n5_0)), rt ∈ Ω(1 + n50)
half(gen_0':s3_0(*(2, n249_0))) → gen_0':s3_0(n249_0), rt ∈ Ω(1 + n2490)
-(gen_0':s3_0(n676_0), gen_0':s3_0(n676_0)) → gen_0':s3_0(0), rt ∈ Ω(1 + n6760)
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
No more defined symbols left to analyse.
(18) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
double(gen_0':s3_0(n5_0)) → gen_0':s3_0(*(2, n5_0)), rt ∈ Ω(1 + n50)
(19) BOUNDS(n^1, INF)
(20) Obligation:
TRS:
Rules:
double(
0') →
0'double(
s(
x)) →
s(
s(
double(
x)))
half(
0') →
0'half(
s(
0')) →
0'half(
s(
s(
x))) →
s(
half(
x))
-(
x,
0') →
x-(
s(
x),
s(
y)) →
-(
x,
y)
if(
0',
y,
z) →
yif(
s(
x),
y,
z) →
zhalf(
double(
x)) →
xTypes:
double :: 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
half :: 0':s → 0':s
- :: 0':s → 0':s → 0':s
if :: 0':s → if → if → if
hole_0':s1_0 :: 0':s
hole_if2_0 :: if
gen_0':s3_0 :: Nat → 0':s
Lemmas:
double(gen_0':s3_0(n5_0)) → gen_0':s3_0(*(2, n5_0)), rt ∈ Ω(1 + n50)
half(gen_0':s3_0(*(2, n249_0))) → gen_0':s3_0(n249_0), rt ∈ Ω(1 + n2490)
-(gen_0':s3_0(n676_0), gen_0':s3_0(n676_0)) → gen_0':s3_0(0), rt ∈ Ω(1 + n6760)
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
No more defined symbols left to analyse.
(21) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
double(gen_0':s3_0(n5_0)) → gen_0':s3_0(*(2, n5_0)), rt ∈ Ω(1 + n50)
(22) BOUNDS(n^1, INF)
(23) Obligation:
TRS:
Rules:
double(
0') →
0'double(
s(
x)) →
s(
s(
double(
x)))
half(
0') →
0'half(
s(
0')) →
0'half(
s(
s(
x))) →
s(
half(
x))
-(
x,
0') →
x-(
s(
x),
s(
y)) →
-(
x,
y)
if(
0',
y,
z) →
yif(
s(
x),
y,
z) →
zhalf(
double(
x)) →
xTypes:
double :: 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
half :: 0':s → 0':s
- :: 0':s → 0':s → 0':s
if :: 0':s → if → if → if
hole_0':s1_0 :: 0':s
hole_if2_0 :: if
gen_0':s3_0 :: Nat → 0':s
Lemmas:
double(gen_0':s3_0(n5_0)) → gen_0':s3_0(*(2, n5_0)), rt ∈ Ω(1 + n50)
half(gen_0':s3_0(*(2, n249_0))) → gen_0':s3_0(n249_0), rt ∈ Ω(1 + n2490)
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
No more defined symbols left to analyse.
(24) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
double(gen_0':s3_0(n5_0)) → gen_0':s3_0(*(2, n5_0)), rt ∈ Ω(1 + n50)
(25) BOUNDS(n^1, INF)
(26) Obligation:
TRS:
Rules:
double(
0') →
0'double(
s(
x)) →
s(
s(
double(
x)))
half(
0') →
0'half(
s(
0')) →
0'half(
s(
s(
x))) →
s(
half(
x))
-(
x,
0') →
x-(
s(
x),
s(
y)) →
-(
x,
y)
if(
0',
y,
z) →
yif(
s(
x),
y,
z) →
zhalf(
double(
x)) →
xTypes:
double :: 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
half :: 0':s → 0':s
- :: 0':s → 0':s → 0':s
if :: 0':s → if → if → if
hole_0':s1_0 :: 0':s
hole_if2_0 :: if
gen_0':s3_0 :: Nat → 0':s
Lemmas:
double(gen_0':s3_0(n5_0)) → gen_0':s3_0(*(2, n5_0)), rt ∈ Ω(1 + n50)
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
No more defined symbols left to analyse.
(27) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
double(gen_0':s3_0(n5_0)) → gen_0':s3_0(*(2, n5_0)), rt ∈ Ω(1 + n50)
(28) BOUNDS(n^1, INF)